package com.xxxx.microservice.forestry.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 静态资源请求和处理
 */
@Configuration
public class StaticHandler implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/res/**") // 虚拟url路径
                .addResourceLocations("file:res/"); // 真实本地路径
    }
}


